/*
** unittest for wTest
** The MIT License (MIT)
** Copyright (c) <2016> <avaicode>
*/

#include <stdio.h>
#include "src/luaport/exporter.h"

int main(void) {
    lua_State* L = luaL_newstate();
    OpenBuiltInLibs(L);

    lua_newtable(L);
    lua_pushstring(L, "-v"); // open verbose mode for luaunit
    lua_rawseti(L, -2, 1);
    lua_setglobal(L, "arg");

    luaL_dostring(L, "package.path = package.path .. \";./?.lua;../src/?.lua\"");

    if (luaL_dofile(L, "test_all.lua")) {
        puts(lua_tostring(L, -1));
        puts("");
        puts("Test Error!(Check if you run me in `test` folder)");
    }

    lua_close(L);
    return 0;
}
